<template>
  <div class="basic-from" v-dialogDrag>
    <el-dialog
      custom-class="small-padding-dialog"
      :close-on-click-modal="false"
      title="离点详细信息"
      :visible.sync="dialogVisible"
      width="70%"
      @close="handleClosed"
    >
      <div class="card-title" v-show="type !== 'preview'">离点人员基本信息</div>
      <PersonInfo :personId="personId" />
      <div class="card-title" v-show="type !== 'preview'">离点信息</div>
      <leaveInfo :id="leaveId"/>
    </el-dialog>
  </div>
</template>

<script>

import PersonInfo from "./components/personInfo.vue"
import leaveInfo from "./components/leaveInfo.vue"
export default {
  name: "preLeaveDialog",
  components: {
    PersonInfo,
    leaveInfo,
  },
  data() {
    return {
      //弹窗类型，默认新增
      type: "preview",
      //选中的物业
      radioId: "",
      //弹窗开关
      dialogVisible: false,
      // 表单项
      formData: {},
      personId:"",
      leaveId:""
    };
  },
  computed: {},
  methods: {
    //开启弹窗,请求数据
    async show({ type, data = {} }) {
      console.log(data);
      // 请求接口拿到详细数据
      this.type = type;
      this.dialogVisible = true;
    },
    // 弹窗关闭还原
    handleClosed() {
      
    },
  },
};
</script>

<style lang="scss" scoped>
.addDialog {
  /deep/ .el-date-editor--datetime {
    width: 100%;
  }
  .album {
    .el-col {
      margin-bottom: 20px;
    }
    .img {
      width: 100%;
      height: 200px;
    }
  }
}
</style>
